<template>
  <div class="question_content" @click="questionClick">
    <div class="title">{{item.tag}}</div>
    <div class="desc">
      <span>题库简介:</span>
      <span>{{item.description || item.tag}}</span>
    </div>
  </div>
</template>

<script>
  export default {
    name: "Question",
    props: {
      item: {
        type: Object,
        default() {
          return {}
        }
      }
    },
    methods: {
      questionClick() {
        this.$router.push({
          path: '/search/question/detail',
          name: 'questionDetail',
          params: {
            id: this.item._id,
            tag: this.item.tag
          }
        }, onComputed => {}, onAbort => {})
      }
    }
  }
</script>

<style scoped>
  .question_content {
    margin: 20px 30px 0;
    padding: 20px;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    font-size: 15px;
  }

  .question_content:hover {
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0,0,0,.1);
  }

  .title {
    font-size: 16px;
    font-weight: 700;
  }

  .desc {
    margin-top: 8px;
    line-height: 1.5;
  }

  .desc span:nth-child(1) {
    margin-right: 10px;
  }
</style>
